<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>MapV 面</title>
    <script type="text/javascript" include="jquery" src="../js/include-web.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" include="mapv" src="../../dist/include-leaflet.js"></script>
<script type="text/javascript">
    var map = L.map('map', {
        center: [39.93, 116.402],
        zoom: 12,
    });

    var host = window.isLocal ? document.location.protocol + "//" + document.location.host : "http://support.supermap.com.cn:8090";
    var url = host + "/iserver/services/map-china400/rest/maps/ChinaDark";

    L.supermap.tiledMapLayer(url).addTo(map);
    loadData();

    //示例数据来源为百度MapV的加偏数据，iClient9未做纠偏处理
    function loadData() {
        $.get('../data/beijing-village.json', function (geojson) {
            var dataSet = new mapv.DataSet(geojson);

            var options = {
                fillStyle: 'rgba(255, 80, 53, 0.8)',
                strokeStyle: 'rgba(250, 255, 53, 0.8)',
                size: 3,
                lineWidth: 1,
                draw: 'simple'
            };

            var dataAttr = "数据来源<a target='_blank' href='http://mapv.baidu.com/examples/beijing-village.html'>MapV</a>";
            L.supermap.mapVLayer(dataSet, options, {attributionPrefix: dataAttr}).addTo(map);


            setTimeout(function () {
                map.openPopup("示例数据来源为百度MapV的加偏数据，iClient9未做纠偏处理", map.getCenter());
            }, 1000)
        });
    }


</script>

</body>
</html>
